class User{
    constructor(data){
        this.new(data);
    }

    new(data) {
        Object.keys(data).forEach(field => {
            this[field] = data[field];
        })
    }

    data() {
        let data = {};
        Object.keys(this).forEach(field => {
            data[field] =this[field];
        })
        return data;
    }

    get(field){
        return this[field];
    }

    set(field, value) {
        this[field] = value;
    }
}

export default User;
